package com.htu.edu.service.impl;

import com.htu.edu.bean.OrderDetailet;
import com.htu.edu.mapper.OrderDetailetMapper;
import com.htu.edu.service.OrderDetailetService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class OrderDetailetServiceImpl implements OrderDetailetService {
    @Autowired
    private OrderDetailetMapper orderDetailetMapper;
    @Override
    public int saveOrderDetailetBatch(List<OrderDetailet> list) throws Exception {
        for (OrderDetailet orderDetailet:list) {
            orderDetailetMapper.saveOrderDetailetBatch(orderDetailet);
        }
        return 1;
    }

    @Override
    public List<OrderDetailet> listOrderDetailetByOrderId(Integer orderId) throws Exception {
        return orderDetailetMapper.listOrderDetailetByOrderId(orderId);
    }
}
